package com.chuangjiangx.member.coupon.ddd.domain.model;

/**
 * Created by Lenovo on 2018/8/28.
 */
public enum WxCouponWeekType {
    MONDAY("MONDAY", "1"),
    TUESDAY("TUESDAY", "2"),
    WEDNESDAY ("WEDNESDAY", "3"),
    THURSDAY ("THURSDAY", "4"),
    FRIDAY ("FRIDAY", "5"),
    SATURDAY ("SATURDAY", "6"),
    SUNDAY ("SUNDAY", "7");

    public final String name;
    public final String code;

    WxCouponWeekType(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public static WxCouponWeekType get(String code){
        for(WxCouponWeekType type : values()){
            if(type.code.equals(code)){
                return type;
            }
        }
        return null;
    }
}
